package Source;

import java.util.ArrayList;

/**
 * The create airport model
 * @author Joshua King
 */
public class CreateAirport {
    private String APLocation;
    private String APName;
    private String APTax;
/**
 *checks to see if an airport is valid
 * 
 */
    public boolean checkValidity() {
        if (APLocation.equals("") || APName.equals("") || APTax.equals("")) {
            return false;
        }
        return true;
    }

    /**
 *
 * writes an airpot to the database
 */
    public boolean commitData() {
        FlightServerInteraction logIn = new FlightServerInteraction();
        ArrayList<String> request = new ArrayList<String>();
        request.add(0, "airportCreate");
        request.add(1, APName);
        request.add(2, APLocation);
        request.add(3, APTax);
        
        logIn.run(request);
        return true;
    }

       /**
 *
 * sets the airport location
        * @param text the location
 */
    public void setAPLocation(String text) {
        APLocation = text;
    }
/**
 * sets the airport name
        * @param text the name
 */
    public void setAPName(String text) {
        APName = text;
    }
/**
 * sets the airport tax
        * @param text the tax
 */
    public void setAPTax(String text) {
        APTax = text;
    }
}
